
#!/bin/bash
# 进入离线包目录
cd /opt/offline-upgrade

# 安装所有依赖
rpm -Uvh deps/*.rpm --nodeps --force

# 升级OpenSSL
rpm -Uvh openssl/*.rpm --nodeps --force
ldconfig  # 更新动态链接库:ml-citation{ref="5" data="citationList"}

# 升级OpenSSH
systemctl stop sshd               # 停止服务:ml-citation{ref="2" data="citationList"}
rpm -Uvh openssh/*.rpm --nodeps --force
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak  # 备份配置:ml-citation{ref="8" data="citationList"}

# 修复SELinux策略
restorecon -Rv /etc/ssh /usr/sbin/sshd  # 修复SELinux标签:ml-citation{ref="5" data="citationList"}

# 启动服务并验证
systemctl daemon-reload
systemctl start sshd
ssh -V  # 验证版本
